proc parsenicklist {listbox nicklist} {
	set nicklist [lsort $nicklist]
	set owners [list]
	set admins [list]
	set ops [list]
	set halfops [list]
	set voices [list]
	set normals [list]
	
	foreach user $nicklist {
		if [regexp {~(.+)} $user -> n_user] {
			lappend owners $n_user
		} elseif [regexp {&(.+)} $user -> n_user] {
			lappend admins $n_user
		} elseif [regexp {@(.+)} $user -> n_user] {
			lappend ops $n_user
		} elseif [regexp {%(.+)} $user -> n_user] {
			lappend halfops $n_user
		} elseif [regexp {\+(.+)} $user -> n_user] {
			lappend voices $n_user
		} else {
			lappend normals $user
		}
	}
	
	foreach user $owners {
		set idx [$listbox size]
		$listbox insert end "~$user"
		$listbox itemconfigure $idx -foreground grey39
	}
	
	foreach user $admins {
		set idx [$listbox size]
		$listbox insert end "&$user"
		$listbox itemconfigure $idx -foreground darkgreen
	}
	
	foreach user $ops {
		set idx [$listbox size]
		$listbox insert end "@$user"
		$listbox itemconfigure $idx -foreground darkred
	}
	
	foreach user $halfops {
		set idx [$listbox size]
		$listbox insert end "%$user"
		$listbox itemconfigure $idx -foreground purple
	}
	
	foreach user $voices {
		set idx [$listbox size]
		$listbox insert end "+$user"
		$listbox itemconfigure $idx -foreground blue
	}
	
	foreach user $normals {
		set idx [$listbox size]
		$listbox insert end "$user"
	}
}
